var path = require('path')
var wordsParser = require(path.join(__dirname, "../wordsParser/wordsParser.js")); //引用词法解析模块
var handleFunction = require(path.join(__dirname, "../handleFunction/handleFunction.js"));
var handleVarTree = require(path.join(__dirname, "../handleVarTree/handleVarTree.js"));
var url = path.join(__dirname, '../lessScript/lessScript').toString(); //获得脚本路径
var words = wordsParser.parseWords(url); //执行词法解析并且输出结果
var FuntionArray = handleFunction.getFunctionArray(words);
words = handleFunction.getParsedWords(words);
var varTree = handleVarTree.createVarTree(words, 0, 'global');

console.log(words);

//for循环是一个这样的递归结构
var forAttr = function(id, key, array, childrenBlock) {
        this.id = id;
        this.key = key;
        this.array = array;
}
    //while循环是这样一个递归的结构
var whileAttr = function(id, boolean, childrenBlock) {
        this.id = id;
        this.boolean = boolean;
    }
    //if也是这样的一个递归的结构
var ifAttr = function(id, boolean, childrenBlock) {
    this.id = id;
    this.boolean = boolean;
}

exports.getCodingBlocks = function() {
    var container = [];
    var temp = [];
    for (var Key in words) {
        var key = parseInt(Key);
        temp.push(words[key]);

    }
}

/*
for(set <key> in <array>){
	if(true){
		dosomething();
	}
}
if(<boolean>){
	dosomething();
}
while(<boolean>){
	dosomething();
}

forBlock : {
	id : '',
	key :'',
	array : '',
	childrenBlock :[]
}
ifBlock : {
	id : '',
	boolean : '',
	childrenBlock : []
}
whileBlock : {
	id : '',
	boolean : '',
	childrenBlock : []
}
*/
